/**
 * Copyright © 2011 Creativor Studio.
 * About license information, please see LICENSE.txt.
 */

package org.creativor.rayson.protocol;

import org.creativor.rayson.annotation.ClientVersion;
import org.creativor.rayson.api.RpcProtocol;
import org.creativor.rayson.api.ServiceRegistration;
import org.creativor.rayson.exception.RpcException;
import org.creativor.rayson.exception.ServiceNotFoundException;

/**
 * Basic interface of the RPC server.
 * 
 * @author Nick Zhang
 */
@ClientVersion(1)
public interface ServerProtocol extends RpcProtocol
{
	
	/**
	 * Find.
	 * 
	 * @param serviceName
	 *            the service name
	 * @return the service registration
	 * @throws ServiceNotFoundException
	 *             the service not found exception.
	 * @throws RpcException
	 *             If exception occurred when handling this RPC request.
	 */
	public ServiceRegistration find(String serviceName) throws ServiceNotFoundException,
			RpcException;
	
	/**
	 * List.
	 * 
	 * @return the service registration[]
	 * @throws RpcException
	 *             If exception occurred when handling this RPC request.
	 */
	public ServiceRegistration[] list() throws RpcException;
	
	/**
	 * Gets the server info.
	 * 
	 * @return the server info
	 * @throws RpcException
	 *             If exception occurred when handling this RPC request.
	 */
	public String getServerInfo() throws RpcException;
	
}
